<%--
    Document   : Register
    Created on : Sep 29, 2012, 4:34:35 PM
    Author     : MinhThang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp" %>
<%@page import="org.apt.Bean.SeminarEntities"%>
<%@page import="com.myapp.DAO.SeminarDao"%>
<%@page import="org.apt.connectDB.Tools"%>
<%@page import="java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <meta http-equiv="content-type" content="text/html; charset=windows-1252" />
        <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine&amp;v1#" />
        <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" />
        <link rel="stylesheet" type="text/css" href="style/style.css" />
        <style type="text/css">
            * {font-family:Arial, Helvetica, sans-serif;
               font-size:10pt;}
            </style>
            <script type="text/javascript">
                function checkinputpass(){
                    var stringserch = document.fsearchSeminar.txtSeaerchSeminar.value;
                    if(stringserch==null || stringserch =="")
                    {
                        alert('Please enter the search string');
                        document.fsearchSeminar.txtSeaerchSeminar.focus();
                        return false;
                    }
                    return true;
                }
            </script>
            <title>Lacture</title>
        </head>
        <body>
            <div>
                <div><%@include file="UserTemplate/Banner.jsp" %></div>
                <div id="site_content">
                    <div id="content">
                        <div id="search" style="float: right; margin-right: 10px">
                        <form  action="SeminarSearch.jsp" method="post" name="fsearchSeminar" onsubmit="return checkinputpass();">
                            <input id="textinput" type="text" name="txtSeaerchSeminar" id="pagestatus" style="width: 250px;text-indent: 20px; color: blue"/><input type="submit" id="buttomsearch" value="Search" style="color: red ; font-weight: bold"/>
                        </form>
                    </div><br><br>
                    <form action="MemberEdit.jsp"   method="post"  name="fmember" id="fmember">
                        <table  class="tableRegiter" style="width: 99.5%">
                            <%
                                        int totalpage = Tools.getTotalPage("Seminar") / 10;
                                        if (Tools.getTotalPage("Seminar") % 10 > 0) {
                                            totalpage = totalpage + 1;
                                        }
                                        int pageno = 1;
                                        String npage = "";
                                        try {
                                            int pagenumber = Integer.parseInt(request.getParameter("pageno"));
                                            if (pagenumber > 1) {
                                                pageno = pagenumber;
                                            }
                                            if (pagenumber < 1) {
                                                pageno = 1;
                                            }
                                            if (pagenumber > totalpage) {
                                                pageno = totalpage;
                                            }
                                            List<SeminarEntities> SeminarList = SeminarDao.getSeminar(pageno);
                                            if (SeminarList == null) {
                                                return;
                                            } else {
                                                for (SeminarEntities seminar : SeminarList) {
                            %>
                            <tr>
                                <td colspan="2"><a id="title" href="SeminarDetails.jsp?id=<%=seminar.getSeminarID()%>"><span class="tihle"><%=seminar.getSeminarName()%></span> </a>
                                    <span style="float: right"><div id="sharefacebook"><script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><style> html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 0px; height:15px; border:1px solid #d8dfea; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; text-decoration:none; } </style> <a rel="nofollow" href="http://www.facebook.com/share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share on facebook</a></div></span>
                                </td>
                            </tr>
                            <tr>
                                <td width="150px">
                                    <div id="div-image"><a id="title" href="SeminarDetails.jsp?id=<%=seminar.getSeminarID()%>"><img class="img" src="images/imagemember/<%=seminar.getImage()%>" width="150px" height="120px" alt="Not image" /></a> </div>
                                </td>
                                <td valign="top">
                                    <%=seminar.getContent()%>
                                    <br><a href="SeminarDetails.jsp?id=<%=seminar.getSeminarID()%>" id="detailnew" style="float: right">view details</a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" ><img src="images/sperate.png" width="98%" height="2px" /></td>
                            </tr>
                            <% }
                                            }
                                        } catch (Exception ex) {
                                            ex.printStackTrace();
                                        }%>
                            <tr>
                                <td colspan="6">
                                    <div align="center">
                                        <a class="button" href="Seminar.jsp?pageno=1"> FIRST </a>
                                        <a class="button" href="Seminar.jsp?pageno=<%=pageno - 1%>"> BACK </a>
                                        <input id="pagestatus" type="text" class="button" disabled value="<%=pageno%>/<%=totalpage%>" style="width: 70px; text-align: center" />
                                        <a class="button" href="Seminar.jsp?pageno=<%=pageno + 1%>"> NEXT </a>
                                        <a class="button" href="Seminar.jsp?pageno=<%=totalpage%>"> LAST </a>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
                <div><%@include file="UserTemplate/MenuRight.jsp" %></div>
            </div>
            <div></div>
            <div><%@include file="UserTemplate/Footer.jsp" %></div>
        </div>
        <script type="text/javascript" src="ng_all.js"></script>
        <script type="text/javascript" src="components/calendar.js"></script>
    </body>
</html>